package com.lms.generictype.demo1;

import java.util.List;
import java.util.Random;

/**
 * @Author: 李孟帅
 * @CreateTime: 2020-01-16 14:03
 * @Description: ${Description}
 */
public class ProductGetter<T> {

    private Random random = new Random();

    private T product;
    private List<T> list;

    public ProductGetter(List<T> list) {
        this.list = list;
    }

    public T getProduct() {
        product = list.get(random.nextInt(list.size()));
        return product;
    }

    public <E> E getValue(E value) {
        return value;
    }



}

